import torch
tensor = torch.tensor([[1, 2], [3, 4]])
np_array = tensor.numpy()  # 转换为 NumPy 数组
print(np_array)
# 输出: [[1 2]
#        [3 4]]